import request from '@/utils/request'

// 获取员工列表渲染
export function getUserList(params) {
  return request({
    url: '/users',
    method: 'get',
    params
  })
}

// 获取员工的总数量
export function getUserCount() {
  return request({
    url: '/users/count',
    method: 'get'
  })
}

// 添加员工
export function addUserRegister(data) {
  return request({
    url: '/auth/local/register',
    method: 'post',
    data
  })
}

// 编辑员工
export function editUserRegister(data) {
  return request({
    url: '/users/' + data.id,
    method: 'put',
    data
  })
}

// 根据id查询到员工的详情信息
export function setUserRegister(id) {
  return request({
    url: '/users/' + id,
    method: 'get'
  })
}

// 删除员工
export function delUserRegister(id) {
  return request({
    url: '/users/' + id,
    method: 'delete'
  })
}
